import React from 'react'
import PropTypes from 'prop-types'
import {
  inject,
  observer,
} from 'mobx-react'

import { withStyles } from 'material-ui/styles'

import UserWrapper from './user'
import infoStyle from './styles/info'

@inject(stores => ({
  user: stores.appState.user,
})) @observer
class Info extends React.Component {
  componentDidMount() {

  }

  render() {
    const { classes, user } = this.props
    return (
      <UserWrapper>
        <div className={classes.root}>
          <div>{ user.info.loginname ? user.info.loginname : 'Singura' }</div>
        </div>
      </UserWrapper>
    )
  }
}

Info.wrappedComponent.propTypes = {
  user: PropTypes.object.isRequired,
}

Info.propTypes = {
  classes: PropTypes.object.isRequired,
}

export default withStyles(infoStyle)(Info)

